from rest_framework.permissions import BasePermission


class TeacherPermission(BasePermission):
    def has_permission(self, request, view):
        if request.user.role == 1 or request.user.role == 2:
            return True
        else:
            return False


class AdminPermission(BasePermission):
    def has_permission(self, request, view):
        if request.user.role == 2:
            return True
        else:
            return False
